(function (window) {
    window.addEventListener('load', function () {
        $('#head').after(`
            <div class="sidebar_menu">
            <div class="base_nav_items">
                <a href="./index.html">首页</a>
            </div>
            <div class="base_nav_items">
                <a href="javascript:;">走进太格</a>
                <p></p>
                <div class="opa opa_zou">
                    <ul class="clearFix">
                        <li><a href="./html/w1-1.html">
                                <p><span class="iconfont icon-qiyejianjie"></span></p> 公司简介
                            </a></li>
                        <li><a href="./html/w1-2.html">
                                <p><span class="iconfont icon-kaifangpingtai"></span></p> 创新开发
                            </a></li>
                        <li><a href="./html/w1-3.html">
                                <p><span class="iconfont icon-biji"></span></p> 大事件
                            </a></li>
                        <li><a href="./html/w1-4.html">
                                <p><span class="iconfont icon-mubiao"></span></p> 太格理念
                            </a></li>
                        <li><a href="./html/w1-5.html">
                                <p><span class="iconfont icon-rongyu"></span></p> 资质荣誉
                            </a></li>
                    </ul>
                </div>
            </div>
            <div class="base_nav_items">
                <a href="javascript:;"> 媒体中心</a>
                <p></p>
                <div class="opa opa_xin">
                    <ul class="clearfix">
                        <li><a href="./html/x1-1.html">
                                <p><span class="iconfont icon-quanbuxinwen"></span></p> 新闻资讯
                            </a></li>
                        <li><a href="./html/x1-2.html">
                                <p><span class="iconfont icon-zixun"></span></p> 行业资讯
                            </a></li>

                    </ul>
                </div>
            </div>
            <div class="base_nav_items">
                <a href="javascript:;"> 产品与解决方案</a>
                <p></p>
                <div class="opa opa_chan">
                    <ul class="clearfix">
                        <li><a href="./html/o1-1.html">
                                <p><span class="iconfont icon-fangan"></span></p> 解决方案
                            </a></li>
                        <li><a href="./html/o1-2.html">
                                <p><span class="iconfont icon-tuya_huabanfuben"></span></p> 产品中心
                            </a></li>
                        <li><a href="./html/o1-3.html">
                                <p><span class="iconfont icon-icon-test"></span></p> 应用业绩
                            </a></li>
                        <li><a href="./index.html">
                                <p><span class="iconfont icon-fuwu"></span></p> 服务与支持
                            </a></li>

                    </ul>
                </div>
            </div>
            <div class="base_nav_items">
                <a href="javascript:;"> 人才发展</a>
                <p></p>
                <div class="opa opa_ren">
                    <ul class="clearfix">
                        <li><a href="./html/x2-1.html">
                                <p><span class="iconfont icon-jingwuicon_svg-"></span></p> 致梦想者
                            </a></li>
                        <li><a href="./html/x2-2.html">
                                <p><span class="iconfont icon-duoren"></span></p> 人才理念
                            </a></li>
                        <li><a href="./html/x2-3.html">
                                <p><span class="iconfont icon-jiarujiazu"></span></p> 加入太格
                            </a></li>

                    </ul>
                </div>


            </div>
            <div class="base_nav_items">
                <a href="javascript:;"> 投资者关系</a>
                <p></p>
                <div class="opa opa_gong">
                    <ul class="clearfix">
                        <li><a href="./html/y-1.html">
                                <p><span class="iconfont icon-dibudaohanglan-"></span></p> 公司公告
                            </a></li>
                    </ul>
                </div>
            </div>
        </div>
        `);
        console.log($('.base_head .menu'));
        let off = false;
        $('.base_head .menu').on('touchstart', function () {
            off = !off;
            if (!off) {
                $('.sidebar_menu .base_nav_items').children(':not("a")').removeClass('active');
            }
            $(".sidebar_menu").toggleClass('active');
        })
        $('.sidebar_menu .base_nav_items a').on('touchstart', function () {
            let current = $(this).parent();
            current.children(':not("a")').addClass('active').parents('.sidebar_menu .base_nav_items').siblings().children(':not("a")').removeClass('active');
        })
    })
})(window);